﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LDCRNewEdit.UI.游戏数据
{
    public partial class InputValueForm : Form
    {
        public InputValueForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        public string show(string value)
        {
            this.textBox1.Text = value;

            DialogResult result = this.ShowDialog();
            if (result == DialogResult.OK)
            {
                return this.textBox1.Text;
            }
            else
            {
                return value;
            }
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 13)
            {
                button1_Click(sender, e);
            }
        }
    }
}
